﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EntLib
{
    [Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationElementType(typeof(FileConfigurationSourceElement))]
    class FileConfigurationSource : Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource
    {

        public FileConfigurationSource(string configurationFilepath)
            : base(configurationFilepath)
        {
        }
    }
    class FileConfigurationSourceElement : Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSourceElement
    {
        public override Microsoft.Practices.EnterpriseLibrary.Common.Configuration.IConfigurationSource CreateSource()
        {
            string configurationFilepath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this.FilePath);
            return new FileConfigurationSource(configurationFilepath);
        }
    }

}
